import { Component, OnInit, Inject, ChangeDetectionStrategy } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';

@Component({
  selector: 'app-new-task-list',
  templateUrl: './new-task-list.component.html',
  styleUrls: ['./new-task-list.component.scss'],
  //ChangeDetectionStrategy.OnPush 不用检查当前组件树是否变化  除非 你告诉我  手动设置
  changeDetection:ChangeDetectionStrategy.OnPush
})
export class NewTaskListComponent implements OnInit {
  title:string ="";
  constructor(@Inject(MAT_DIALOG_DATA) private data,private dialogRef:MatDialogRef<NewTaskListComponent>) { }

  ngOnInit() {
    this.title = this.data.title;
  }
  onClick(){
    this.dialogRef.close(this.title)
  }

}
